﻿using System;
using System.Windows;
using System.Windows.Input;
using MTBrainStorm.Framework.Commands.Args;

namespace MTBrainStorm.Framework.Commands.Parameters
{
    public class TouchParameterConverter : IParameterConverter
    {
        public object Convert(object o, Type paramType)
        {
            if (o.GetType() != typeof(TouchEventArgs))
                return null;

            var e = (TouchEventArgs) o;

            var args = new TouchArgs
                           {
                               Position = e.TouchDevice.GetTouchPoint(null).Position,
                               DeviceId = e.TouchDevice.Id
                           };

            return args;
        }
    }
}
